<?php


namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laravel\Sanctum\HasApiTokens;

/**
 * App\Models\User
 * @mixin \Eloquent
 */
class User extends Authenticatable
{
    use HasApiTokens;
    use SoftDeletes;

    protected $hidden = ['password'];

    public function createDeviceToken(string $device = null)
    {
        return [
            'token_type' => 'Bearer',
            'token' => $this->createToken($device??'mobile')->plainTextToken,
        ];
    }
}
